#ifndef PWM_DRIVER_H
#define PWM_DRIVER_H

#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/queue.h"

#include "driver/ledc.h"
#include "esp_err.h"

#include "../Product_Config.h"
#include "../LOG.h"
#define LEDC_W_TIMER              LEDC_TIMER_0
#define LEDC_W_MODE               LEDC_LOW_SPEED_MODE
#define LEDC_W_OUTPUT_IO          (13) // Define the output GPIO
#define LEDC_W_CHANNEL            LEDC_CHANNEL_0
#define LEDC_W_DUTY_RES           LEDC_TIMER_14_BIT // Set duty resolution to 10 bits
#define LEDC_W_FREQUENCY          (4000) // Frequency in Hertz. Set frequency at 10 kHz

#define LEDC_CW_TIMER              LEDC_TIMER_1
#define LEDC_CW_MODE               LEDC_LOW_SPEED_MODE
#define LEDC_CW_OUTPUT_IO          (15) // Define the output GPIO
#define LEDC_CW_CHANNEL            LEDC_CHANNEL_1
#define LEDC_CW_DUTY_RES           LEDC_TIMER_14_BIT // Set duty resolution to 10 bits
#define LEDC_CW_FREQUENCY          (4000) // Frequency in Hertz. Set frequency at 10 kHz


#define PWM_SUM 8192*2


extern QueueHandle_t pwm_queue_handle;
void device_pwm_init(void);

#endif
